home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / surfsrc3.zip / ARCCOS.INC < prev    next >
Text File  |  1989-08-10  |  290b  |  12 lines

  1. function ARCCOS (X: real): real;
  2. { returns the arc-cosine of X in radians }
  3. begin
  4.   { Prevent errors on out-of-range }
  5.   if (X >= 1.0) then
  6.     Arccos := 0.0
  7.   else if (X <= -1.0) then
  8.     Arccos := 3.141592654
  9.   else
  10.     Arccos := -arctan(X / sqrt (-X * X + 1)) + 1.5708;
  11. end;
  12.